<template>
	<view class="container">
		<view>
			<desc-wrapper :title="title" :desc="desc"></desc-wrapper>
			<z-card title="基本信息">
				<block v-if="resp">
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">缘主姓名:</text>
						<text class="card-content_right">{{resp.base_info.name }}</text>
					</view>
					<view class="card-content-item justify-between">

						<text class="shrink-0 card-content-label_left">出生公历:</text>
						<text class="card-content_right">{{resp.base_info.gongli }}</text>

					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">出生农历:</text>
						<text class="card-content_right">{{resp.base_info.nongli}}</text>
					</view>
					<view class="card-content-item justify-between">

						<text class="shrink-0 card-content-label_left">八字生辰:</text>
						<text class="card-content_right">{{resp.base_info.jiaoyun_mang}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">星宿信息:</text>
						<text class="card-content_right">{{resp.base_info.xingxiu}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">年柱纳音:</text>
						<text class="card-content_right">{{resp.detail_info.sizhu_info.year.ny}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">命卦信息:</text>
						<text class="card-content_right">{{resp.base_info.minggua.minggua_fangwei}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">生肖星座:</text>
						<text class="card-content_right">{{resp.base_info.shengxiao }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">五行旺度:</text>
						<text class="card-content_right">{{resp.base_info.wuxing_wangdu }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">起运信息:</text>
						<text class="card-content_right">{{resp.base_info.qiyun}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">交运信息:</text>
						<text class="card-content_right">{{resp.base_info.jiaoyun }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">天干留意:</text>
						<text class="card-content_right">{{resp.base_info.tiangan_liuyi}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">地支留意:</text>
						<text class="card-content_right">{{resp.base_info.dizhi_liuyi}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="shrink-0 card-content-label_left">胎元命身:</text>
						<text class="card-content_right">{{resp.base_info.taiyuan}}</text>
					</view>
				</block>
			</z-card>
			<z-card title="喜用神分析">
				<block v-if="resp">
					<view class="card-content-item " style="display: block; ">
						日主天干为{{'【'+resp.base_info.xiyongshen.rizhu_tiangan+'】'}}，同类为{{'【'+resp.base_info.xiyongshen.tonglei+'】'}},异类为{{'【'+resp.base_info.xiyongshen.yilei+'】'}}
						<text class="card-text-red">八字偏弱</text>，以{{'【'+resp.base_info.xiyongshen.xiyongshen+'】'}}为喜用神
					</view>
					<view class="card-content-item">
						<text class="card-content-label_left shrink-0">阴阳参考:</text>
						<text class="card-content_right">{{resp.base_info.xiyongshen.yinyang}}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">五行统计:</text>
						<text
							class="card-content_right">{{resp.base_info.xiyongshen.jin_number}}金，{{resp.base_info.xiyongshen.mu_number}}木，{{resp.base_info.xiyongshen.shui_number}}水，{{resp.base_info.xiyongshen.huo_number}}火，{{resp.base_info.xiyongshen.tu_number}}土，自党：{{resp.base_info.xiyongshen.zidang}}，异党：{{resp.base_info.xiyongshen.yidang}}</text>
					</view>
					<view class="card-content-item">
						<text class="card-content-label_left shrink-0">五行能量:</text>
						<text class="card-content_right">
							金：{{resp.base_info.xiyongshen.jin_score}}分，占比{{resp.base_info.xiyongshen.jin_score_percent}}，
							木：{{resp.base_info.xiyongshen.mu_score}}分，占比{{resp.base_info.xiyongshen.mu_score_percent}}，
							水：{{resp.base_info.xiyongshen.shui_score}}分，占比{{resp.base_info.xiyongshen.shui_score_percent}}，
							火：{{resp.base_info.xiyongshen.huo_score}}分，占比{{resp.base_info.xiyongshen.huo_score_percent}}，
							土：{{resp.base_info.xiyongshen.tu_score}}分，占比{{resp.base_info.xiyongshen.tu_score_percent}}</text>
					</view>
				</block>
			</z-card>

			<z-card title="日柱论命">
				<block v-if="resp">
					<text style="font-size: 12px;font-weight: 300;"
						class="card-content_right">{{resp.detail_info.sizhu_info.sizhu_indication.xingge.rizhu}}</text>
				</block>
			</z-card>
			<z-card title="性格分析">
				<block v-if="resp" >
					<text style="font-size: 12px;font-weight: 300;" class="card-content_right">{{resp.detail_info.sizhu_info.sizhu_indication.wuxing.detail_description}}</text>
				</block>
			</z-card>
			<z-card title="财运分析">
				<block v-if="resp">
					<text style="font-size: 12px;font-weight: 300;" class="card-content_right">{{resp.detail_info.sizhu_info.sizhu_indication.caiyun.sanshishu_caiyun.detail_desc}}</text>
				</block>
			</z-card>
			<z-card title="姻缘分析">
				<block v-if="resp">
					<text style="font-size: 12px;font-weight: 300;" class="card-content_right">{{resp.detail_info.sizhu_info.sizhu_indication.yinyuan.sanshishu_yinyuan}}</text>
				</block>
			</z-card>
			<!-- <z-card title="运程分析">
				<block v-if="resp">

				</block>
			</z-card> -->
			<z-card title="五行分析">
				<block v-if="resp">
					<text style="font-size: 12px;font-weight: 300;" class="card-content_right">{{resp.detail_info.sizhu_info.sizhu_indication.wuxing.simple_description}}</text>
				</block>
			</z-card>


			<view class="bottom-btns" style="transform: translateY(-100%);" @click="todashi">
				<view class="start-btn">
					<text>大师详解</text>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: ' 八字测算',
				desc: '测试方法：输入您的信息，点击立即测算，并查看测算结果，请自行体会其中的指示。',
				resp: null,
			}
		},
		onLoad(opt) {
			let params = JSON.parse(opt.formData)
			this.jingsuan(params)
		},
		methods: {
			jingsuan(params) {
				const that = this
				uni.request({
					url: 'https://cs.appzdm.com:3000/Bazi/jingsuan',
					method: 'POST',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					data: params,
					success: (res) => {
						that.resp = res.data.data
					},
					fail: (error) => {
						console.error('Request Failed:', error)
					}
				})
			},
			todashi(){
				uni.switchTab({
					url:'/pages/tabbar/service'
				})
			}

		}
	}
</script>
<style lang="scss" scoped></style>